# 筛选词性

import pandas as pd
import nltk

# 情感分析中重要的词性
m_tags = ['MD', 'UH', 'VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ', 'RP', 'RB', 'RBR', 'RBS', 'JJ', 'JJR', 'JJS']


inputfile = r"..\data\microwave_7removed_stopwords.tsv"
outputfile = r"..\data\microwave_8select_form.tsv"

m_data = pd.read_csv(inputfile, sep='\t', encoding='utf-8')
# print(m_data)
m_data = m_data[m_data.form.isin(m_tags)]  # 筛选出对应词性的词

m_data.to_csv(outputfile, sep='\t', index=0, header=1, encoding='utf-8')
